package server

import (
	"context"

	"gitee.com/gtsoa/mspkg/soa/auth"
	"google.golang.org/grpc"
)

var passMethods []string = []string{
	"/GetDemo",
}

func AuthUnaryIntercepter(isMultiAuth bool) func(context.Context, interface{}, *grpc.UnaryServerInfo, grpc.UnaryHandler) (interface{}, error) {
	ai := auth.NewAuthInterceptor("/gtsoa.bsdemo.s")
	ai.SetMiltiAuth(isMultiAuth)
	return ai.SetPassMethods(passMethods).UnaryIntercepter()
}
